#include <stdio.h>
#include <limits.h>
int main()
{
    int num, min = INT_MAX;
    while( scanf("%d", &num) != EOF ){
        if( num < 0){
            printf("%d\n", min);
            min = INT_MAX;
        }else if(min > num)
            min = num;
    }
    return 0;
}